package com.zhz.web.order.controller;

import com.zhz.order.feign.OrderFeign;
import com.zhz.order.pojo.Order;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("worder")
public class WebOrderController {
    
    @Autowired
    private OrderFeign orderFeign;
    
    @GetMapping("/genToken")
    public String genToken() {
        return orderFeign.genToken();
    }
    
    /**
     * 新增订单
     */
    @PostMapping("/addOrder")
    String addOrder(@RequestBody Order order) {
        return orderFeign.addOrder(order);
    }
    
    /**
     * 新增订单
     */
    @PostMapping("/addOrder2")
    String addOrder2(@RequestBody Order order) {
        return orderFeign.addOrder2(order);
    }
}
